{% extends "base.html" %}
{% load i18n %}
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html lang="en">
<head>
    <title>Search{% if query %} Results{% endif %}</title>
</head>
{% block content %}
<body>
  <h1 class="changeBlue">Client Details</h1>
  <form action="." method="GET">
    <label for="q">Job Id: </label>
    <input type="text" name="q" value="{{ query|escape }}">
    <input type="submit" value="Search">
  </form>

  {% if query %}
    <h2>Results for "{{ query|escape }}":</h2>

    {% if results %}
      <ul>
      {% for job in results %}
        <li>Job Id : {{ job.id }}</li>
        <li>Material : {{job.clientjob__material__name}}</li>
	<li>Name:{{job.client__client__first_name}}</li>
        <li>Site : {{job.site}}</li>
        <li>Address : {{job.client__client__address}}</li>
        <li>Sample No : {{job.report__Sample_no}}</li>
        <li>Report : {{job.report__id}}</li>
	        <b><a href="{{ LOCAL_URL }}/automation/report/report_gen/?id={{ job.id }}">Get Report</a></b>

<!--
<form action="" method="POST">{% csrf_token %}
    <label for="job">Job:</label><input type="text" name="job" value={{ job.id }} id="job" />
    <label for="report">Report:</label><input type="text" name="report" value={{job.report__id}} id="report" />
    <label for="material">Material:</label><input type="text" name="material" value={{job.clientjob__material__name}} id="material" />

    <p><input type="submit" value="Add"></p>
</form>
-->

	</br></br>
	{% endfor %}
      </ul>
    {% else %}
      <p>No Job Found</p>
    {% endif %}
  {% endif %}
</body>
</html>
{% endblock %}
